package com.minicat.servlet;

/**
 * @author liangzj
 * @date 2021/3/28 17:22
 */
public abstract class HttpServlet implements Servlet {

    public abstract void doGet(Request request, Response response);

    public abstract void doPost(Request request, Response response);

    @Override
    public void init() {
    }

    @Override
    public void service(Request request, Response response) {
        if ("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request, response);
        } else {
            doPost(request, response);
        }
    }

    @Override
    public void destroy() {
    }

}
